package com.jfinal.demo.web.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * 会员表单验证
 * 
 * @author Administrator
 * 
 */
public class MemberValidator extends Validator {

	@Override
	protected void validate(Controller c) {
		c.getFiles("member");
		validateRequiredString("member.name", "nameMsg", "请输入用户名！");
		validateInteger("member.age", 1, 120, "ageMsg", "年龄范围在1到120之间！");
	}

	@Override
	protected void handleError(Controller c) {
		c.keepPara();
		c.render("show.jsp");
	}

}
